// 路由组件懒加载
const Home = () => import("@/views/Home");
const Search = () => import("@/views/Search");
const Login = () => import("@/views/Login");
const Register = () => import("@/views/Register");
const NotFound = () => import("@/views/NotFound");

const routes = [
  // 默认路由
  {
    path: "/",
    redirect: "/home",
  },
  // 静态路由
  {
    path: "/home",
    name: "Home",
    component: Home,
  },
  {
    path: "/search",
    name: "Search",
    component: Search,
  },
  {
    path: "/login",
    name: "Login",
    component: Login,
    meta: {
      footerIsHidden: true,
    },
  },
  {
    path: "/register",
    name: "Register",
    component: Register,
    meta: {
      footerIsHidden: true,
    },
  },
  // 任意路由
  {
    path: "*",
    name: "NotFound",
    component: NotFound,
  },
];

export default routes;
